#ifndef ACTIVATIONFUNCTION_H
#define ACTIVATIONFUNCTION_H

#include<cmath>
#include<algorithm>
#include<unordered_map>
#include<functional>
#include<string>

namespace wawa{
    double inline leakyReLU(double x, double alpha = 0.01) { return x > 0 ? x : alpha * x; }

    double inline dLeakyReLU(double x, double alpha = 0.01) { return x > 0 ? 1.0 : alpha; }

    double inline Relu(double x) { return std::max(0.0, x); }

    double inline dRelu(double x) { if (x <= 0) return 0; else return 1; }

    double inline Tanh(double x) { return tanh(x); }

    double inline dTanh(double x) { return 1 - pow(tanh(x), 2); }

    double inline Sigmoid(double x) { return 1.0f / 1L + exp(-x); }

    double inline dSigmoid(double x) { return Sigmoid(x) * (1 - Sigmoid(x)); }

    double inline Softmax(double x, double sum) { return exp(x) / sum; }

    double inline dSoftmax(double x, double sum) { return exp(x) / sum; }
}


#endif


